1. Field of the Invention
The present invention relates to an electronic device, and in particular relates to a button device.
2. Description of the Related Art
Please refer to FIG. 1. FIG. 1 shows a schematic diagram of a first related button device 100. The button device 100 comprises a MCU 110, a plurality of pins 121, 122, 123 and 124, and a plurality of buttons 131, 132, 133 and 134. As shown in figure, the buttons 131,132,133 and 134 are coupled to the MCU 110 respectively through the pins 121, 122, 123 and 124. When a user presses the button 131, the electric signal on pin 121 changes. The MCU 110 can detect that the button 131 is pressed according to the electric signal from pin 121 and performs corresponding action. From the above description we know that the button device 100 needs to reserve a pin number at least equal to the button number. In other words, if there are N buttons on the button device, the MCU needs to reserve N pins for the buttons. Ideally, the pin number of the MCU is not limited. However, the more pins, the larger the required chip area.
Please refer to FIG. 2. FIG. 2 shows a schematic diagram of a second related button device 200. The button device 200 comprises a MCU 210, a plurality of pins 221, 222, 223, 224, 225 and 226, and a plurality of buttons 231, 232, 233, 234, 235, 236, 237, 238 and 239. The connection of each pin is provided as follows:
pin 221 is connected to a terminal of the buttons 231,232,233;
pin 222 is connected to a terminal of the button 234,235,236;
pin 223 is connected to a terminal of the button 237,238,239;
pin 224 is connected to another terminal of the buttons 231,234,237;
pin 225 is connected to another terminal of the buttons 232,235,238;
pin 226 is connected to another terminal of the buttons 233,236,239.
The pins 221,222,223 are utilized to send the enabling signals to the coupled buttons. For example, when a user presses the button 231, the pin 221 sends the enabling signal to the button 231 and the MCU 210 can detect that the button 231 is pressed through the pin 224 connected to the button 231. From the above description it can be seen that the button device 200 only needs to reserve six pins even though it has nine buttons. The relationship between the pin number N and the button number M changes with various designs. Generally, the pin number N is designed to be less than the button number M. Compared with the first related button device 100, in a predetermined button number, the button device 200 utilizes less pins. This kind of architecture is commonly seen in remote controllers.
Please refer to FIG. 3. FIG. 3 shows a schematic diagram of a third related button device 300. The button device 300 comprises a MCU 310, a plurality of pins 321 and 322, an analog-to-digital converter (ADC) 340, and a plurality of buttons 331,332,333, and 334. The input terminal of ADC 340 is coupled to the plurality of buttons 331,332,333, and 334 and the output terminal of the ADC 340 is coupled to the plurality of pins 321 and 322. Since the resistances of the resistors connected to buttons are different (e.g. R, 2R, 4R, 6R), the corresponding voltage levels sent to the input terminal are different when different buttons are pressed. As shown in the figure, four different buttons map to four different voltage levels and the required pin number of the ADC 330 is equal to the value log24=2. From the description we know that the button device 300 needs to reserve a pin number at least equal to the value log2N if there are N buttons. Compared with the first and second related button devices 100 and 200, the greater the desired button numbers, the more the number of pin can be reduced. The ADC, however, is expensive and occupies a large area.
Please refer to FIG. 4. FIG. 4 shows a schematic diagram of a fourth related button device 400. The button device 400 comprises a control unit 410. The operation of the control unit 410 similar to the button device 300 is to detect buttons according to different voltage levels, however, it suffers from the same disadvantage of chip area and cost. A detailed description is provided in the Taiwan patent number I226731. Further discussion is omitted for the sake of brevity.